package com.ruoyi.english.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.english.mapper.EnBookMapper;
import com.ruoyi.english.domain.EnBook;
import com.ruoyi.english.service.IEnBookService;

/**
 * 单词本Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-25
 */
@Service
public class EnBookServiceImpl implements IEnBookService 
{
    @Autowired
    private EnBookMapper enBookMapper;

    /**
     * 查询单词本
     * 
     * @param bookId 单词本主键
     * @return 单词本
     */
    @Override
    public EnBook selectEnBookByBookId(Long bookId)
    {
        return enBookMapper.selectEnBookByBookId(bookId);
    }

    /**
     * 查询单词本列表
     * 
     * @param enBook 单词本
     * @return 单词本
     */
    @Override
    public List<EnBook> selectEnBookList(EnBook enBook)
    {
        return enBookMapper.selectEnBookList(enBook);
    }

    /**
     * 新增单词本
     * 
     * @param enBook 单词本
     * @return 结果
     */
    @Override
    public int insertEnBook(EnBook enBook)
    {
        enBook.setCreateTime(DateUtils.getNowDate());
        return enBookMapper.insertEnBook(enBook);
    }

    /**
     * 修改单词本
     * 
     * @param enBook 单词本
     * @return 结果
     */
    @Override
    public int updateEnBook(EnBook enBook)
    {
        return enBookMapper.updateEnBook(enBook);
    }

    /**
     * 批量删除单词本
     * 
     * @param bookIds 需要删除的单词本主键
     * @return 结果
     */
    @Override
    public int deleteEnBookByBookIds(Long[] bookIds)
    {
        return enBookMapper.deleteEnBookByBookIds(bookIds);
    }

    /**
     * 删除单词本信息
     * 
     * @param bookId 单词本主键
     * @return 结果
     */
    @Override
    public int deleteEnBookByBookId(Long bookId)
    {
        return enBookMapper.deleteEnBookByBookId(bookId);
    }
}
